#include "fecore.h"
#include "fecore_private.h"
#include "feapplication_private.h"
#include "feactualdataservice_private.h"
#include "fewidgetfactory_private.h"

// FeCore members
FeCore *FeCore::instance()
{
	return FeCoreImpl::instance();
}

// FeCoreImpl members
FeCoreImpl::FeCoreImpl(FeApplication *application)
: FeCore(application)
{
	this->application = application;
}

FeCoreImpl::~FeCoreImpl()
{
}

FeCoreImpl *FeCoreImpl::instance()
{
	FeApplication *application = FeApplication::instance();
	return application ? application->fecore : 0;
}


FeActualDataService *FeCoreImpl::actualDataService() const
{
	return application->ads;
}

void FeCoreImpl::registerController(FeController *controller)
{
	Q_ASSERT(!application->ctls.contains(controller));
	application->ctls.append(controller);
}

void FeCoreImpl::registerWidgetFactory(FeWidgetFactory *factory)
{
	application->syswf->registerWidgetFactory(factory);
}

void FeCoreImpl::registerDataProvider(FeActualDataProvider *provider)
{
	application->ads->registerDataProvider(provider);
}
	
